<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="log"></div>
<script><![CDATA[
  if (window.testRunner)
      testRunner.dumpAsText();

  var xhtmlNS = "http://www.w3.org/1999/xhtml";
  
  var logDiv = document.getElementById("log");
  
  function debugLog(s) {
    var logDiv = document.getElementById("log");
    logDiv.appendChild(document.createTextNode(s));
    logDiv.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "br"));
  }
  
  debugLog("document.xmlEncoding : " + document.xmlEncoding);
  debugLog("document.xmlVersion : " + document.xmlVersion);
  debugLog("document.xmlStandalone : " + document.xmlStandalone);
  debugLog("document.readyState : " + document.readyState);
  
  
  var div = document.createElementNS(xhtmlNS, "div");

  var newXML = ''
  newXML += '<?xml version="1.0" encoding="iso-8859-1"?>';
  newXML += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
  newXML += '<html xmlns="http://www.w3.org/1999/xhtml">';
  newXML += '</html>';

  try {
    div.innerHTML = newXML;
  } catch (e) {
    debugLog("div.innerHTML = threw exception: " + e);
  } finally {
    debugLog("document.xmlEncoding : " + document.xmlEncoding);
    debugLog("document.xmlVersion : " + document.xmlVersion);
    debugLog("document.xmlStandalone : " + document.xmlStandalone);
    debugLog("document.readyState : " + document.readyState);
  }
  
]]></script>
</html>
